<?php
# !!!!!!!!!! DON'T MAKE ANY CHANGE IF YOU DON'T KNOW WHAT YOU'RE DOING !!!!!!!!!!
// --------------------------------------------------------------------------------------------------------------
// File Name              :	page.php
// Last Modification Time	:	2008-02-01 24:00
// Last Modified by       :	turker (turker.biz@gmail.com)
// list of modifications	:
//
//	- 2008-02-01 turker
//		* 24:00 file created.
//
// --------------------------------------------------------------------------------------------------------------
if (eregi("page.php",$_SERVER['PHP_SELF'])) {
	header ("Location:../index.php");
	exit;
}

$id=getID($PAGES_TABLE);
if (!$id) {
  header ("Location:$SITE_URL/index.php?page=404");
	exit;
}

?>
<!--div:icerik -->
    <div id="icerik">
      <p>
<?php
//id, title, content, name, date, order, active, lang
$active="and active='1'";
if (isAdmin()) $active='';
$q=$mysql->query("select title,content,`date`,active from $PAGES_TABLE where id='$id' and lang='$SITE_DEF_LANG' $active order by `order` asc");
if ($mysql->numRows($q)==1) {
  $read=$mysql->fetch($q);
  $title=$prep->html($read['title']);
  $content=nl2br($read['content']);
  $active=$read['active'];
  $date=date('d/m/Y',$read['date']);
  if (isAdmin()) {
    if ($active=='1') $active='<img src="template/img/active.gif" title="Sayfa Aktif" class="adminicon" />';
    else $active='<img src="template/img/notactive.gif" title="Sayfa Aktif Değil" class="adminicon" />';
    echo '<div id="page_edit_div" style="display:none;"><img src="template/img/loading.gif" title="Yükleniyor..." /></div>'
        .$active.'<img src="template/img/delete.gif" class="adminicon" title="Sil" id="page_del" rel="'.$id.'" /> '
        .'<img src="template/img/edit.gif" class="adminicon" title="Düzenle" id="page_edit" rel="'.$id.'" /> ';
  }
  echo "<h1>$title</h1>"
      ."<h6>".$_LANG['page']['lupdate'].": $date</h6>"
      ."<p>$content</p>";
}
else echo '<br />'.$_LANG['page']['error1'].'<br />';
?>
      </p>
    </div>
<!--//div:icerik -->